﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Paginas_Administrador/MasterPageAdmin.Master" AutoEventWireup="true" CodeBehind="NoticiaCadastro.aspx.cs" Inherits="WEB_MechSysWeb.Paginas_Administrador.NoticiaCadastro" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .auto-style1 {
            height: 25px;
        }      
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMaster" runat="server">
    <div style="height: 1240px">
        <asp:UpdatePanel ID="UpdatePanelGeral" runat="server">
            <ContentTemplate>
                <div class="divTituloCad">
                    Cadastro de Notícias
                </div>
                <asp:UpdatePanel ID="UpdatePanelGridNoticias" runat="server">
                    <ContentTemplate>
                        <div id="divNoticias" class="divGridNoticias">
                            <div class="divHeaderCad">
                                Notícias Cadastradas
                            </div>
                            <div id="divFiltroAgenda">
                                <asp:Label ID="Label3" runat="server" Font-Size="Medium" ForeColor="Black" Text="Filtrar Por Data: "></asp:Label>
                                <asp:TextBox ID="txtDataFiltro" runat="server" Width="320px"></asp:TextBox>
                                <AjaxControlToolkit:MaskedEditExtender ID="mskDataFiltro" runat="server" ClearMaskOnLostFocus="false" Mask="99\/99\/9999" PromptCharacter="_" TargetControlID="txtDataFiltro">
                                </AjaxControlToolkit:MaskedEditExtender>
                                <AjaxControlToolkit:CalendarExtender ID="CalendarExtenderFiltro" runat="server" Format="dd/MM/yyyy" TargetControlID="txtDataFiltro">
                                </AjaxControlToolkit:CalendarExtender>
                                <asp:ImageButton ID="imgbtnPesquisar" runat="server" BorderColor="#3F3F3F" BorderStyle="Groove" BorderWidth="2px" Height="22px" 
                                    ImageUrl="~/Imagens/Find.png" OnClick="imgbtnPesquisar_Click" Width="26px" CssClass="botaoPesquisaNot" />
                            </div>
                            <asp:GridView ID="gridNoticias" runat="server" AllowPaging="True" AutoGenerateColumns="False" AutoGenerateSelectButton="True" BackColor="#F3F3F3" BorderColor="#333333" BorderStyle="Groove" BorderWidth="3px" CssClass="gridAgend" DataKeyNames="NoticiaID" Height="51px" OnSelectedIndexChanged="gridNoticias_SelectedIndexChanged" Width="630px">
                                <AlternatingRowStyle BackColor="#CCCCCC" BorderColor="#333333" BorderStyle="Outset" BorderWidth="3px" ForeColor="Black" />
                                <Columns>
                                    <asp:BoundField DataField="NoticiaID" HeaderText="NoticiaID" />
                                    <asp:BoundField DataField="Titulo" HeaderText="Titulo" />
                                    <asp:BoundField DataField="DataInicio" HeaderText="Data Inicio" />
                                    <asp:BoundField DataField="DataFinal" HeaderText="Data Final" />
                                    <asp:BoundField DataField="DataRegistro" HeaderText="Data Registro" />
                                    <asp:BoundField DataField="ClienteEspecifico" HeaderText="Cliente Especifico" />
                                </Columns>
                                <HeaderStyle BackColor="#3F3F3F" ForeColor="White" />
                                <SelectedRowStyle BackColor="#3F3F3F" ForeColor="White" />
                            </asp:GridView>
                            <br />
                            <br />
                            <asp:LinkButton ID="lnkbtnAnterior" runat="server" CssClass="linkAnterior" ForeColor="Gray" OnClick="lnkbtnAnterior_Click" ValidationGroup="lnk">&lt;&lt;Anterior</asp:LinkButton>
                            &nbsp;&nbsp;&nbsp;
                    <asp:LinkButton ID="lnkbtnProximo" runat="server" CssClass="linkProximo" ForeColor="Gray" OnClick="lnkbtnProximo_Click" ValidationGroup="lnk">Próximo&gt;&gt;</asp:LinkButton>
                        </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="lnkbtnAnterior" EventName="Click" />
                        <asp:AsyncPostBackTrigger ControlID="lnkbtnProximo" EventName="Click" />
                        <asp:AsyncPostBackTrigger ControlID="imgbtnPesquisar" EventName="Click" />
                        <asp:AsyncPostBackTrigger ControlID="btnSalvar" EventName="Click" />
                        <asp:AsyncPostBackTrigger ControlID="btnExcluir" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
                <div id="divDados" class="divDadosPerfil" style="height: 558px">
                    <div class="divHeaderCad">
                        Cadastrar Notícia
                    </div>
                    <table class="tableDadosPerfil">
                        <tr>
                            <td class="auto-style12">
                                <asp:Label ID="Label1" runat="server" CssClass="Labels" Text="Título*: "></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtTitulo" runat="server" Width="320px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*Campo obrigatório!"
                                    ControlToValidate="txtTitulo" ForeColor="Red" ValidationGroup="vgtxt"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style12">
                                <asp:Label ID="Label2" runat="server" CssClass="Labels" Text="Resumo*: "></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtResumo" runat="server" Width="320px" Height="61px" TextMode="MultiLine" ValidationGroup="vgtxt"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*Campo obrigatório!"
                                    ControlToValidate="txtResumo" ForeColor="Red" ValidationGroup="vgtxt"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style12">
                                <asp:Label ID="Label4" runat="server" CssClass="Labels" Text="Texto: "></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtTexto" runat="server" Width="320px" Height="131px" TextMode="MultiLine" ValidationGroup="vgtxt"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ErrorMessage="*Campo obrigatório!"
                                    ControlToValidate="txtTexto" ForeColor="Red" ValidationGroup="vgtxt"></asp:RequiredFieldValidator>
                            </td>
                        </tr>                      
                        <tr>
                            <td class="auto-style12"></td>
                            <td>
                                <asp:CheckBox ID="chkEspecificaCliente" runat="server" Text="Especificar Cliente" OnCheckedChanged="chkEspecificaCliente_CheckedChanged" AutoPostBack="True" />
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style12">
                                <asp:Label ID="Label7" runat="server" CssClass="Labels" Text="EspecificarCliente*: "></asp:Label>
                            </td>
                            <td>
                                <asp:UpdatePanel ID="UpdatePanelLst" runat="server">
                                    <ContentTemplate>
                                        <asp:ListBox ID="lstboxCliente" runat="server" DataTextField="Nome" DataValueField="ClienteID" 
                                            Enabled="False" Width="320px" OnSelectedIndexChanged="lstboxCliente_SelectedIndexChanged" AutoPostBack="True"></asp:ListBox>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="chkEspecificaCliente" EventName="CheckedChanged" />
                                        <asp:AsyncPostBackTrigger ControlID="btnRemoverCliente" EventName="Click" />
                                        <asp:AsyncPostBackTrigger ControlID="lstboxCliente" EventName="SelectedIndexChanged" />
                                    </Triggers>
                                </asp:UpdatePanel>
                                <asp:Button ID="btnSelecionaCliente" runat="server" CssClass="botaoSelecionaCliente" Text="..." Enabled="False" />
                                <asp:Button ID="btnRemoverCliente" runat="server" CssClass="botaoSelecionaCliente" Text="X" Enabled="False" OnClick="btnRemoverCliente_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style1">
                                <asp:Label ID="Label8" runat="server" CssClass="Labels" Text="Data Inicial: "></asp:Label>
                            </td>
                            <td class="auto-style1">
                                <asp:TextBox ID="txtDataInicial" runat="server" Width="320px" ValidationGroup="vgtxt"></asp:TextBox>
                                <AjaxControlToolkit:MaskedEditExtender ID="mskDataInicial" runat="server" TargetControlID="txtDataInicial"
                                    Mask="99\/99\/9999" ClearMaskOnLostFocus="false" PromptCharacter="_">
                                </AjaxControlToolkit:MaskedEditExtender>
                                <AjaxControlToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDataInicial"
                                    Format="dd/MM/yyyy">
                                </AjaxControlToolkit:CalendarExtender>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="*Campo obrigatório!"
                                    ControlToValidate="txtDataInicial" ForeColor="Red" ValidationGroup="vgtxt"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style12"></td>
                            <td>
                                <asp:CheckBox ID="chkDefinePeriodo" runat="server" Text="Definir Período de Exibição" OnCheckedChanged="chkDefinePeriodo_CheckedChanged" AutoPostBack="True" />
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style12">
                                <asp:Label ID="Label15" runat="server" CssClass="Labels" Text="Data Final: "></asp:Label>
                            </td>
                            <td>
                                <asp:UpdatePanel ID="UpdatePanelDt" runat="server">
                                    <ContentTemplate>
                                        <asp:TextBox ID="txtDataFinal" runat="server" Enabled="False" Width="320px"></asp:TextBox>
                                        <AjaxControlToolkit:MaskedEditExtender ID="mskDataFinal" runat="server" ClearMaskOnLostFocus="false" Mask="99\/99\/9999" PromptCharacter="_" TargetControlID="txtDataFinal">
                                        </AjaxControlToolkit:MaskedEditExtender>
                                        <AjaxControlToolkit:CalendarExtender ID="CalendarExtender2" runat="server" Format="dd/MM/yyyy" TargetControlID="txtDataFinal">
                                        </AjaxControlToolkit:CalendarExtender>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="chkDefinePeriodo" EventName="CheckedChanged" />
                                    </Triggers>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style12">
                                <asp:Label ID="Label23" runat="server" CssClass="Labels" Text="Imagens:"></asp:Label>
                            </td>
                            <td>
                                <AjaxControlToolkit:AsyncFileUpload ID="AsyncFileUpImagens" runat="server" OnUploadedComplete="AsyncFileUpImagens_UploadedComplete" Enabled="False" UploaderStyle="Modern" />
                            </td>
                        </tr>                      
                    </table>
                    <div id="divBotoes" class="divBotoesNoticia">
                        <asp:Button ID="btnNovo" runat="server" Text="Novo" OnClick="btnNovo_Click" CssClass="botoesNoticia" />
                        <asp:Button ID="btnEditar" runat="server" Text="Editar" OnClick="btnEditar_Click" CssClass="botoesNoticia" />
                        <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" OnClick="btnCancelar_Click" CssClass="botoesNoticia" />
                        <asp:Button ID="btnExcluir" runat="server" Text="Excluir" OnClick="btnExcluir_Click" CssClass="botoesNoticia" />
                        <asp:Button ID="btnSalvar" runat="server" Text="Salvar" OnClick="btnSalvar_Click" CssClass="botoesNoticia" ValidationGroup="vgtxt" />
                    </div>
                </div>
                <asp:Panel ID="PnSelecionaCliente" runat="server">
                    <table style="width: 100%; height: 222px;" class="tableModal">
                        <tr>
                            <td class="style1">
                                <div class="divHeaderCad">
                                    Selecione o Cliente
                            <asp:Button ID="btnFecharPCliente" runat="server" Text="Fechar" CssClass="botaoFecharPopUp" />
                                </div>
                                <asp:GridView ID="gridSelecioneCliente" runat="server" Height="86px" Width="623px" AutoGenerateColumns="False"
                                    AutoGenerateSelectButton="True" BackColor="#F3F3F3" BorderColor="#333333" BorderStyle="Groove" BorderWidth="3px"
                                    DataKeyNames="ClienteID" OnSelectedIndexChanged="gridSelecioneCliente_SelectedIndexChanged">
                                    <AlternatingRowStyle BackColor="#CCCCCC" BorderColor="#333333" BorderStyle="Outset" BorderWidth="3px" ForeColor="Black" />
                                    <Columns>
                                        <asp:BoundField DataField="ClienteID" HeaderText="ClienteID" />
                                        <asp:BoundField DataField="Nome" HeaderText="Nome" />
                                        <asp:BoundField DataField="Veiculo" HeaderText="Veiculo" />
                                        <asp:BoundField DataField="Placa" HeaderText="Placa" />
                                        <asp:BoundField DataField="Contato" HeaderText="Contato" />
                                        <asp:BoundField DataField="Email" HeaderText="Email" />
                                        <asp:BoundField DataField="AgendamentoPendente" HeaderText="Agendamentos" />
                                    </Columns>
                                    <HeaderStyle BackColor="#3F3F3F" ForeColor="White" />
                                    <SelectedRowStyle BackColor="#3F3F3F" ForeColor="White" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>
                    </table>
                </asp:Panel>
                <AjaxControlToolkit:ModalPopupExtender
                    ID="PnSelecionaCliente_ModalPopupExtender"
                    runat="server"
                    Enabled="True"
                    TargetControlID="btnSelecionaCliente"
                    PopupControlID="PnSelecionaCliente"
                    DropShadow="true"
                    CancelControlID="btnFecharPCliente" />
                </div>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="lnkbtnAnterior" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="lnkbtnProximo" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="imgbtnPesquisar" EventName="Click" />              
            </Triggers>
        </asp:UpdatePanel>
</asp:Content>
